<?php
/**
 * Created by PhpStorm.
 * User: liuhong
 * Date: 2019/1/3
 * Time: 下午7:27
 */

namespace Api\Service;


class CollectionsService extends BaseService
{
    public $collectionsModel;
    public function __construct()
    {
        $this->collectionsModel=M('collections');
    }

    //查询收藏
    public function queryCollections($where){
        return $this->collectionsModel
            ->field('waoo_share.*')
            ->join('waoo_share on waoo_share.id=waoo_collections.share_id')
            ->where($where)
            ->select();
    }

    //添加收藏
    public function add($add){
        return $this->collectionsModel->add($add);
    }

    /**
     * 取消收藏
     * @param $where
     * @return mixed
     */
    public function delCollections($where){
        return $this->collectionsModel->where($where)->delete();
    }

}